package com.lizhen.core.method;

public class SpecialMethod {
    private int id;

    public SpecialMethod(int id) {
        this.id = id;

        System.out.println(id + " is created");
    }

    private static void variableParametersMethod(char... chars) {
        if (chars != null) {
            System.out.println(chars);
        }
    }

    public static void main(String[] args) {
        variableParametersMethod();
        variableParametersMethod('a', 'b');
        SpecialMethod sm1 = new SpecialMethod(1);
        SpecialMethod sm2 = new SpecialMethod(2);
        sm1 = sm2 = null;
        System.gc();
    }

    protected void finalize() throws java.lang.Throwable {
        System.out.println(id + " is disposed");

        super.finalize();
    }
}
